#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(){
   char a[1000000];
   int b=0,c=0;//记录单词的长度
   int n=0,w=0,m=0,i,s=0,h=0;
   gets(a);
   n=strlen(a);
   printf("字符数:%d\n",n);
    for(i=0;i<n;i++){
       if((a[i]==' '||a[i]=='.'||a[i]==','||a[i]=='!'||a[i]=='?')&&(a[i-1]!=' '&&a[i-1]!='.'&&a[i-1]!=','&&a[i-1]!='!'&&a[i-1]!='?')){
         w++;
         c=i;
         m=i-1;
        printf("单词数:%d ",w);
        while(m>=b){
          printf("%c",a[i-m-1+b]); 
          m--;  
        }
        printf("\n"); 
       }
    if((a[i]==' '||a[i]=='.'||a[i]==','||a[i]=='!'||a[i]=='?')&&(a[i+1]!=' '&&a[i+1]!='.'&&a[i+1]!=','&&a[i+1]!='!'&&a[i+1]!='?')){
      b=i+1;
    }//用来排除一次打多个符号的影响
    if(a[i]=='.'||a[i]=='!'||a[i]=='?'){
       s++;
    }
   }
   printf("句子数：%d",s); 
   system("pause");
}
